<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <center>
        <button class="btn">点击生成</button>
    </center>

</body>

<script>
    document.querySelector(".btn").addEventListener('click', () => {
        window.location.href = "/code"
    })
</script>
</html>